{extend name="../../admin/view/main"}

{block name="button"}
<!--{if auth("remove")}-->
<button class='layui-btn layui-btn-sm layui-btn-primary' data-action='{:url("remove")}' data-confirm="确定要删除这些充值记录吗？" data-rule="id#{key}">删除充值</button>
<!--{/if}-->
{/block}

{block name="content"}
<div class="think-box-notify">
    <b>余额统计：</b>累计已充值余额 <b>{$balance.0|default=0.00|number_format}</b> 元，已使用 <b>{$balance.1|default=0.00|number_format}</b> 元，剩余可使用 <b>{$balance.0-$balance.1|number_format}</b> 元。
</div>
<div class="think-box-shadow">
    {include file='user/balance/index_search'}
    <table class="layui-table" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
            </th>
            <th class='text-left nowrap'>用户信息</th>
            <th class='text-left nowrap'>充值金额</th>
            <th class='text-left nowrap'>充值描述</th>
            <th></th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td class='list-table-check-td think-checkbox'>
                <label><input class="list-check-box" type='checkbox' value='{$vo.id}'></label>
            </td>
            <td class="nowrap">
                <div class="headimg headimg-md" data-lazy-src="{$vo.user.headimg|default='__ROOT__/static/theme/img/headimg.png'}" data-tips-image></div>
                <div class="inline-block">
                    <div>用户昵称：<span class="color-text">{$vo.user.nickname|default='--'}</span></div>
                    <div>用户手机：<span class="color-text">{$vo.user.phone|default='--'}</span></div>
                    <div>用户等级：<span>[ <b class="color-red">VIP{$vo.user.vip_code}</b> ] <b class="color-red">{$vo.user.vip_name}</b></span></div>
                </div>
            </td>
            <td class="nowrap">
                <div>交易金额：{if $vo.amount>=0}<b class="color-green">{$vo.amount+0}</b>{else}<b class="color-blue">{$vo.amount+0}</b>{/if} 元</div>
                <div>升级等级：{if $vo.upgrade>0}<span class="color-red">升级到</span> [ <b class="color-red">VIP{$vo.upgrade}</b> ] <b class="color-red">{$vo.upgradeinfo.name|default=''}</b>{else}<span class="color-desc">不进行用户升级</span>{/if}</div>
                <div>操作时间：<span>{$vo.create_at|format_datetime}</span></div>
            </td>
            <td class="nowrap sub-strong-blue">
                <div>充值名称：{$vo.name|default='-'}</div>
                <div>充值单号：<b class="color-blue">{$vo.code|default='-'}</b></div>
                <!--{notempty name='vo.remark'}-->
                <div>充值备注：{$vo.remark}</div>
                <!--{else}-->
                <div>充值备注：<span class="color-desc">未填写充值记录的备注内容</span></div>
                <!--{/notempty}-->
            </td>
            <td class="nowrap">
                <!--{if auth("remove") and stripos($vo.code,'B') === 0}-->
                <a class="layui-btn layui-btn-sm layui-btn-danger" data-action="{:url('remove')}" data-confirm="确定要删除数据吗?" data-value="id#{$vo.id}">删 除</a>
                <!--{/if}-->
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
{/block}